<?php

namespace app\api\model;

use think\Model;

class Text extends Model
{
    // 表名
    protected $name = 'text';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [];


    public static function getText($title)
    {
        return self::where('title', $title)->value('text') ?: "";
    }
}
